package com.transcargo.geo;

public class Object {

	private City city = null;
	private Country country = null;
	private Region region = null;
	private int type = -1;
	public Object(Country c, Region r, City i) {
		if (c != null) {
			country = c;
			type = 0;
		} else if (r != null) {
			region = r;
			type = 1;
		} else if (i != null) {
			city = i;
			type = 2;
		}
	}
	public Boolean isCountry() {
		return type == 0;
	}
	public Boolean isRegion() {
		return type == 1;
	}
	public Boolean isCity() {
		return type == 2;
	}
	public Country getCountry() {
		return country;
	}
	public Region getRegion() {
		return region;
	}
	public City getCity() {
		return city;
	}
}
